<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <title></title>
  <link rel="StyleSheet" href="css/dtree.css" type="text/css"/>
  <link rel="stylesheet" type="text/css" href="css/zTreeStyle.css"/>
  <script src="js/jquery.min.js"></script>
  <script src="../js/jquery.base64.js"></script>
  <script src="js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/jquery.fastLiveFilter.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/jquery.ztree.core-3.5.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/jquery.ztree.excheck-3.5.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/jquery.ztree.exhide.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/fuzzysearch.js" type="text/javascript" charset="utf-8"></script>
  <script src="js/jquery.fastLiveFilter.js" type="text/javascript" charset="utf-8"></script>
  <style type="text/css">
    body,
    html {
      padding: 0;
      margin: 0;
      width: 100%;
      font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
      background: #FFF;

    }

    .chat_choice {
      border-bottom: 1px solid #e0e0e0;
      display: flex;
    }

    .chat_content {
      border-bottom: 1px solid #e0e0e0;
    }

    li {
      list-style: none;
    }

    .groupChat {
      width: 100%;

    }

    .selectorResult {
      border: 1px solid #eee;
      min-height: 30px;
      width: calc(100% - 130px);
      float: right;
      border-radius: 5px;
      padding: 5px;
      position: relative;
      margin: 10px;
    }

    .chat_top {
      width: 100px;
      font-size: 15px;
      color: #666;
      font-weight: bold;
      float: left;
      padding-left: 10px;
      line-height: 70px;
      background: #F3F3F3;
    }

    input.shuru {
      height: 30px;
      width: 300px;
      margin: 5px auto;
      padding: 0 5px;
      color: #7a7171;
      border-radius: 4px;
      border: 1px solid #C9C9C9;
      margin-top: 15px;
    }

    .chat_content {
      height: calc(100% - 50px);
      width: 100%;
      overflow: auto;
    position: fixed;
    }

    .choice_radio {
      height: 80px;
      width: 100%;
      border-bottom: 1px dotted #e2e2e2;
      padding-top: 15px;
    }

    .input-row {
      padding-left: 15px;
      margin-bottom: 10px;
    }

    .customGroup,
    .projectGroup {
      padding: 20px;
      height: calc(100% - 240px);
      overflow: auto;
    }

    .projectGroup ul li {
      cursor: pointer;
      padding-bottom: 10px;
    }

    .screening {
      height: 25px;
      width: 40%;
      margin: 5px auto;
      padding: 0 5px;
      color: #7a7171;
      border-radius: 4px;
      border: 1px solid #C9C9C9;
      margin-left: 10px;
      display: none;
    }

    .saveBtn {
      float: right;
      height: 28px;
      line-height: 28px;
      margin: 15px 15px 0;
      padding: 0 15px;
      border: 1px solid #b64545;
      background-color: #b64545;
      color: #fff;
      border-radius: 2px;
      font-weight: 400;
      cursor: pointer;
    }

    .treeDiv {
      position: fixed;
      background: rgba(0, 0, 0, .25);
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
      display: none;
      z-index: 9;
    }

    .dtree {
      background: #fff;
      width: 40%;
      height: 60%;
      overflow-y: hidden;
      position: absolute;
      top: 20%;
      left: 30%;
      border-radius: 10px;
      padding: 10px;
    }

    .max {
      background: url(./img/max.png) no-repeat center;
      background-size: contain;
      position: absolute;
      bottom: 5px;
      right: 5px;
      height: 20px;
      width: 20px;
      cursor: pointer;
    }

    .ztree {

      height: calc(100% - 40px);
      overflow: auto;
    }

    .btn {
      text-align: right;
      padding-right: 10px;
    }

    .btn button {

    }

    .saveIcon {
      display: inline-block;
      line-height: 1;
      white-space: nowrap;
      cursor: pointer;
      -webkit-appearance: none;
      text-align: center;
      box-sizing: border-box;
      outline: none;
      margin: 0;
      transition: .1s;
      font-weight: 500;
      -moz-user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
      padding: 7px 15px;
      font-size: 14px;
      border-radius: 4px;
      color: #fff;
      background-color: #409eff;
      border: 1px solid #409eff;
      position: absolute;
      right: 10px;
      bottom: 10px;
    }

    .textareaDiv {
      border: 1px solid #eee;
      min-height: 60px;
      width: calc(100% - 35px);
      border-radius: 5px;
      padding: 5px;
      margin: 10px;
    }
    .ztree li{
      position: relative;
    }
    .diycheckbox{
      display: inline-flex;
      align-items: center;
      position: absolute;
      top: 3px;
    }
    .cbBtn{
      margin:0 2px 0 4px;
    }
  </style>

</head>
<body>
<div class="groupChat">

  <div class="chat_content">
    <!--部门选择-->
    <div class="treeDiv" id="dept_div">
      <div class="dtree">
        <ul id="dept_tree" class="ztree"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('dept_div', 'dept_tree')">保存</button>
        </div>
      </div>
    </div>

    <!--用户选择-->
    <div class="treeDiv" id="user_div">
      <div class="dtree">
        关键字：<input type="text" id="key" value="" class="empty" placeholder="请输入关键字"/>
        <ul id="user_tree" class="ztree" style="height: calc(100% - 50px);"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('user_div', 'user_tree')">保存</button>
        </div>
      </div>
    </div>


    <!--角色选择-->
    <div class="treeDiv" id="role_div">
      <div class="dtree">
        <ul id="role_tree" class="ztree"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('role_div', 'role_tree')">保存</button>
        </div>
      </div>
    </div>

    <!--项目团队成员选择-->
    <div class="treeDiv" id="deal_team_div">
      <div class="dtree">
        <ul id="deal_team_tree" class="ztree"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('deal_team_div', 'deal_team_tree')">保存</button>
        </div>
      </div>
    </div>

    <!--基金团队成员选择-->
    <div class="treeDiv" id="fund_team_div">
      <div class="dtree">
        <ul id="fund_team_tree" class="ztree"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('fund_team_div', 'fund_team_tree')">保存</button>
        </div>
      </div>
    </div>

    <!--表单属性-->
    <div class="treeDiv" id="form_field_div">
      <div class="dtree">
        <ul id="form_field_tree" class="ztree"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('form_field_div', 'form_field_tree')">保存</button>
        </div>
      </div>
    </div>

    <!--相对角色选择-->
    <div class="treeDiv" id="relative_div">
      <div class="dtree">
        <ul id="relative_tree" class="ztree"></ul>
        <div class="btn">
          <button class="cancel" onclick="treeDivHide('relative_div', 'relative_tree')">保存</button>
        </div>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        用户
      </div>
      <div class="selectorResult">

        <ul id="user_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('user_div')"></i>
      </div>
    </div>
    <div class="chat_choice">
      <div class="chat_top">
        部门
      </div>
      <div class="selectorResult">

        <ul id="dept_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('dept_div')"></i>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        角色
      </div>
      <div class="selectorResult">

        <ul id="role_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('role_div')"></i>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        项目团队成员
      </div>
      <div class="selectorResult">

        <ul id="deal_team_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('deal_team_div')"></i>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        基金团队成员
      </div>
      <div class="selectorResult">

        <ul id="fund_team_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('fund_team_div')"></i>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        表单属性
      </div>
      <div class="selectorResult">

        <ul id="form_field_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('form_field_div')"></i>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        相对角色
      </div>
      <div class="selectorResult">

        <ul id="relative_tree_select" class="ulSelected">

        </ul>
        <i class="max" onclick="treeDivShow('relative_div')"></i>
      </div>
    </div>

    <div class="chat_choice">
      <div class="chat_top">
        监听器
      </div>
      <div style="width:calc(100% - 90px);">
        <textarea class="textareaDiv" id="listener"></textarea>

      </div>
    </div>

    <!--<div class="chat_choice">-->
      <!--<div class="chat_top">-->
        <!--监听器-->
      <!--</div>-->
      <!--<div style="width:calc(100% - 90px);">-->
        <!--<textarea class="textareaDiv" id="test111"></textarea>-->

      <!--</div>-->
    <!--</div>-->

    <!--<div class="chat_choice">-->
      <!--<div class="chat_top">-->
        <!--监听器-->
      <!--</div>-->
      <!--<div style="width:calc(100% - 90px);">-->
        <!--<textarea class="textareaDiv" id="test222"></textarea>-->

      <!--</div>-->
    <!--</div>-->

  </div>

  <div style="bottom: 12px;left: 10px;position: absolute;">
    是否会签:
    是<input id="huiqian_y" type="radio" name="huiqian" value="Y"/>
    否<input id="huiqian_n" type="radio" name="huiqian" value="N" checked="checked"/>
  </div>
  <button class="saveIcon" onclick="saveData()">保存</button>
</div>

<script type="text/javascript">

  (
    function (open) {
      XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {
        open.call(this, method, url, async, user, pass);//this指XMLHttpRequest
        this.setRequestHeader("Authorization", window.parent.getToken());//mounted时传入的
      }
    }
  )(XMLHttpRequest.prototype.open)


  $(window).resize(function () {
    $('.selectorResult').each(function () {
      $(this).prev().css({
        'height': $(this).height() + 32 + 'px',
        'line-height': $(this).height() + 32 + 'px',
      })
    })
  });
  $(function () {
    $('.selectorResult').each(function () {
      $(this).prev().css({
        'height': $(this).height() + 32 + 'px',
        'line-height': $(this).height() + 32 + 'px',
      })
    })
    $('#search_input').fastLiveFilter('#search_list');


  })

  //树形选择展示
  function treeDivShow(treeDiv) {
    $('#' + treeDiv).show();
  }

  //树形选择隐藏
  function treeDivHide(treeDiv, treeId) {
    treeOnCheck(treeId)
    $('#' + treeDiv).hide();
    // var searchInput = $('#key');
    // searchInput.val('').blur();//清空模糊搜索绑定的input
    // var event = new UIEvent('input');// 构造input事件对象
    // searchInput[0].dispatchEvent(event);// 触发input的input事件
  }
  function delKey(key, id) {
    // console.log(key, id)
    $("#" + id).parent().remove()
    var zTree = $.fn.zTree.getZTreeObj(key);
    var nodes = zTree.getCheckedNodes(true);
    for(var k=0;k<nodes.length;k++){
      if(nodes[k].id==id){
        zTree.checkNode(nodes[k]);//取消这个节点的勾选状态
      }
    }

    if (id && id.includes('_')) {
      var aObj = $('[data-id='+ id + ']')
      aObj.attr("checked", false)
      aObj.removeClass("checkbox_true_full")
    }
  }

  //节点点击事件
  function treeOnCheck(treeId) {
    setTimeout(() => {
      var nodes = $("#" + treeId).find(".checkbox_true_full")
      // console.log(nodes)
      var str = '';
      for (var i = 0, l = nodes.length; i < l; i++) {
        var id = nodes[i].dataset.id
        var key = nodes[i].dataset.name
        if ((id.indexOf("temp_") == -1)) {
          // console.log(nodes[i])
          str += '<li id="' + treeId + '_' + key + '"><input type="hidden" name="' + treeId + '_key" value="' + id + '" />' + key
          str += "<i class='del' id='" + id + "' onclick=\"delKey('" + treeId + "','" + id + "')\">×</i>"
          str += '</li>'
        }

      }
      // console.log(str)
      $("#" + treeId + "_select").html(str);
    }, 500);
  }

  // 页面执行完初始化数据
  $(document).ready(function () {
    // 获取部门待选数据
    getDeptData();

    // 获取用户待选数据
    getUserData();

    // 获取角色待选数据
    getRoleData();

    // 获取表单属性待选数据
    getFormFieldData()

    // 获取相对角色待选数据
    getRelativeData()

    // 获取项目团队成员待选数据
    getDealTeamData()

    // 获取基金团队成员待选数据
    getFundTeamData()

    // 查询之前选择的数据
    getSelectedData();

    // 设置会签状态
    setSignStatus()

    // 设置监听器
    setListener()


  });


  //部门树形结构配置
  var setting = {
    check: {
      enable: true,
      chkboxType: {"Y": "s", "N": "s"}
    },
    data: {
      simpleData: {
        enable: true
      }
    },
    view: {
      addDiyDom: addDiyDom,
    },
    callback: {
      // onCheck: treeOnCheck
    }
  };
  function addDiyDom(treeId, treeNode) {
    $('#' + treeNode.tId + '_check').attr({'data-id': treeNode.key, 'data-name': treeNode.name })
  }


  var _setting = {
    check: {
      enable: true,
      chkboxType: {"Y": "s", "N": "s"}
    },
    data: {
      simpleData: {
        enable: true
      }
    },
    view: {
      addDiyDom: addDiyDomDept,
    },
    callback: {
      // onCheck: treeOnCheck
    }
  };

  function addDiyDomDept(treeId, treeNode) {
    $('#' + treeNode.tId + '_check').attr({'data-id': treeNode.key, 'data-name': treeNode.name })
    var aObj = $("#" + treeNode.tId + '_a');
    var parentName = treeNode.getParentNode() ? treeNode.getParentNode().name : ''
    var editStr = $("<div class='diycheckbox'><input type='checkbox' class='cbBtn' data-id='" + treeNode.key+ "_负责人' data-name='" +parentName + "_" + treeNode.name+ "_负责人' onclick='checkedHandler(this)'>负责人</input><input type='checkbox' class='cbBtn' data-id='" + treeNode.key+ "_分管领导' data-name='" +parentName + "_" + treeNode.name+ "_分管领导' onclick='checkedHandler(this)'>分管领导</input><input type='checkbox' class='cbBtn' data-id='" + treeNode.key+ "_副总' data-name='" +parentName + "_" + treeNode.name+ "_副总' onclick='checkedHandler(this)'>副总</input></div>");
    aObj.after(editStr);
  }

  function checkedHandler(checkbox){
    var $checkbox = $(checkbox)
    if (checkbox.checked) {
      $checkbox.addClass("checkbox_true_full")
    } else {
      $checkbox.removeClass("checkbox_true_full")
    }
  }

  //获取部门数据
  function getDeptData() {
    $.ajax({
      url: window.parent.getBackUrl() + "/wf/approver/deptData",
      dataType: 'json',
      type: "GET",
      async: false,
      cache: false,
      success: function (data) {
        $.fn.zTree.init($("#dept_tree"), _setting, data.data);
      }
    });
  }


  //获取用户数据
  function getUserData() {
    $.ajax({
      url: window.parent.getBackUrl() + "/wf/approver/userData",
      dataType: 'json',
      type: "GET",
      async: false,
      cache: false,
      success: function (data) {
        $.fn.zTree.init($("#user_tree"), setting, data.data);
        fuzzySearch('user_tree','#key',null,true); //初始化模糊搜索方法
      }
    });

  }


  //获取角色数据
  function getRoleData() {
    $.ajax({
      url: window.parent.getBackUrl() + "/wf/approver/roleData",
      dataType: 'json',
      type: "GET",
      async: false,
      cache: false,
      success: function (data) {
        $.fn.zTree.init($("#role_tree"), setting, data.data);
      }
    });
  }

  //获取项目团队成员
  function getDealTeamData() {
    $.ajax({
      url: window.parent.getBackUrl() + "/system/dict/data/dictType/deal_team_role",
      dataType: 'json',
      type: "GET",
      async: false,
      cache: false,
      success: function (data) {
        var treeData = []
        for (var i = 0; i < data.data.length; i++) {
          treeData[i] = {id: data.data[i].dictValue, key: data.data[i].dictValue, name: data.data[i].dictLabel}
        }
        $.fn.zTree.init($("#deal_team_tree"), setting, treeData);
      }
    });
  }

  //获取基金团队成员
  function getFundTeamData() {
    $.ajax({
      url: window.parent.getBackUrl() + "/system/dict/data/dictType/fund_team_role",
      dataType: 'json',
      type: "GET",
      async: false,
      cache: false,
      success: function (data) {
        var treeData = []
        for (var i = 0; i < data.data.length; i++) {
          treeData[i] = {id: data.data[i].dictValue, key: data.data[i].dictValue, name: data.data[i].dictLabel}
        }
        $.fn.zTree.init($("#fund_team_tree"), setting, treeData);
      }
    });
  }

  //获取表单属性
  function getFormFieldData() {
    $.ajax({
      url: window.parent.getBackUrl() + "/wf/approver/formFieldData/" + getUrlParam('modelId'),
      dataType: 'json',
      type: "GET",
      async: false,
      cache: false,
      success: function (data) {
        $.fn.zTree.init($("#form_field_tree"), setting, data.data);
      }
    });
  }

  // 获取相对角色数据
  function getRelativeData() {
    var relativeData = [];
    relativeData.push({id:"temp_apply",pId:"0",name:"申请人",open:true})
    relativeData.push({id:"apply",key:"apply",pId:"temp_apply",name:"申请人本人"})
    relativeData.push({id:"applyDeptLeader",key:"applyDeptLeader",pId:"temp_apply",name:"申请人部门负责人"})
    relativeData.push({id:"applyDeptLeadership",key:"applyDeptLeadership",pId:"temp_apply",name:"申请人部门副总"})
    relativeData.push({id:"applyDeptDeputyGeneral",key:"applyDeptDeputyGeneral",pId:"temp_apply",name:"申请人部门分管领导"})

    relativeData.push({id:"temp_approver",key:"temp_approver",pId:"0",name:"上一审批人",open:true})
    relativeData.push({id:"approver",key:"approver",pId:"temp_approver",name:"上一审批人"})

    $.fn.zTree.init($("#relative_tree"), setting,relativeData);
  }


  /**
   * 保存数据
   */
  function saveData() {
    // 向后台发送的数据
    var reqData = {};

    // 节点唯一标识
    var actUuid = getUrlParam("actUuid");
    reqData.actUuid = actUuid;

    // 配置类型
    var configType = getUrlParam("configType");
    reqData.configType = configType;

    // 模型唯一标识
    var modelId = getUrlParam('modelId');
    reqData.modelId = modelId;

    // 用户已选数据
    var userKeyList = getDataList('user_tree_key');
    reqData.userKeyList = userKeyList;

    // 部门已选数据
    var deptKeyList = getDataList('dept_tree_key');
    reqData.deptKeyList = deptKeyList;

    // 角色已选数据
    var roleKeyList = getDataList('role_tree_key');
    reqData.roleKeyList = roleKeyList;

    // 表单属性已选数据
    var formFieldKeyList = getDataList('form_field_tree_key');
    reqData.formFieldKeyList = formFieldKeyList;

    // 获取项目团队成员待选数据
    var dealTeamKeyList = getDataList('deal_team_tree_key');
    reqData.dealTeamKeyList = dealTeamKeyList;

    // 获取基金团队成员待选数据
    var fundTeamKeyList = getDataList('fund_team_tree_key');
    reqData.fundTeamKeyList = fundTeamKeyList;

    // 相对角色已选
    var relativeList = getDataList('relative_tree_key');
    reqData.relativeList = relativeList;



    $.ajax({
      url: window.parent.getBackUrl() + "/wf/approver/save",
      dataType: 'json',
      type: "POST",
      data: {data: baseL('encode', JSON.stringify(reqData))},
      cache: false,
      success: function (data) {
        updateListener();
        window.parent.layer.msg("保存成功")
        window.parent.closeLayer();
      }
    });



  }

  //获取url传过来的参数
  function getUrlParam(name) { //封装方法
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg); //匹配目标参数
    if (r != null) return unescape(r[2]);
    return null; //返回参数值
  }

  //获取数据集合
  function getDataList(name) {
    var dataList = $("input[name='" + name + "']");
    var dataKeyList = [];
    for (var i = 0; i < dataList.length; i++) {
      dataKeyList[i] = $(dataList[i]).val();
    }
    return dataKeyList;
  }

  //修改监听器
  function updateListener() {
    //监听器
    var listener = $("#listener").val();
    //配置类型
    var configType = getUrlParam('configType');
    //模型ID
    var modelId = getUrlParam('modelId');
    //是否会签
    var isSign = $("input[name='huiqian']:checked").val();
    //节点唯一标识
    var actUuid = getUrlParam('actUuid');

    if ("approval" == configType) {
      if (listener != "" && listener != null && listener != 'null') {
        window.parent.updateApproverListener(listener, isSign);
      } else {
        if (isSign == "Y") {
          window.parent.updateApproverListener("\${approverListener.getApproverList(execution,'" + actUuid + "','" + modelId + "')}",  isSign );
        } else {
          window.parent.updateApproverListener("\${approverListener.getApproverString(execution,'" + actUuid + "','" + modelId + "')}",  isSign);
        }
      }
    }
  }

  //获取已经选择的数据
  function getSelectedData() {
    //模型ID
    var modelId = getUrlParam('modelId');
    //节点唯一标识
    var actUuid = getUrlParam('actUuid');
    $.ajax({
      url: window.parent.getBackUrl() + "/wf/approver/findList?actUuid=" + actUuid + "&modelId=" + modelId,
      dataType: 'json',
      type: "GET",
      cache: false,
      success: function (data) {
        for (var i = 0; i < data.rows.length; i++) {
          writeSelectedData(data.rows[i]);
        }
      }
    });

  }

  // 设置会签状态
  function setSignStatus(){
    var isSign = getUrlParam('isSign');
    if ('Y' === isSign){
      $('#huiqian_y').attr('checked', 'checked');
    }
  }

  // 设置监听器
  function setListener(){
    var listener = getUrlParam('listener');
    if (listener !== null && listener !== 'null'){
      listener = baseL('decode', listener)
      $("#listener").val(listener);
    }
  }


  /**
   * 根据tree标识和审批人标识获取审批人显示名称
   * @param treeKey
   * @param approver
   */
  function getShowName(treeId, approver) {
    var zTree = $.fn.zTree.getZTreeObj(treeId);
    var nodes = zTree.getNodes();
    var node = zTree.getNodeByParam('key', approver);
    if (node != null) {
      // console.log(node)
      zTree.checkNode(node, true, true);
    } else {
      if (approver && approver.includes('_')) {
        var _node = {
          name: approver,
          id: approver
        }
        var aObj = $('[data-id='+ approver + ']')
        aObj.attr("checked", true)
        aObj.addClass("checkbox_true_full")
        return _node
      }
    }
    return node != null ? node : "未找到配置项";
  }

  //写入已选择的数据
  function writeSelectedData(data) {
    var dataHtml = "";
    dataHtml += '<li id="' + data.type + '_tree_' + data.approver + '">';
    dataHtml += '<input type="hidden" name="' + data.type + '_tree_key" value="' + data.approver + '" />';
    dataHtml += getShowName(data.type + '_tree', data.approver).name;
    dataHtml += "<i class='del' id='" + getShowName(data.type + '_tree', data.approver).id + "' onclick=\"delKey('" + data.type + '_tree' + "','" + getShowName(data.type + '_tree', data.approver).id + "')\">×</i>"
    dataHtml += '</li>'

    $("#" + data.type + "_tree_select").append(dataHtml);

  }

</script>


</body>
</html>
